#include "thread.h"

int checkUser(userinfo_t*userinfo,int netfd){
    char pwd[256];
    getcwd(pwd,sizeof(pwd));
    strcat(pwd,"/");
    strcat(pwd,userinfo->username);
    int ret=access(pwd,F_OK);
    if(ret=-1){
        send(netfd,&ret,sizeof(int),MSG_NOSIGNAL);
        return 0;
    }
    send(netfd,&ret,sizeof(int),MSG_NOSIGNAL);

    struct spwd* pUser=getspnam(userinfo->username);
    ERROR_CHECK(pUser,NULL,"getspnam");

    

    recvn(netfd,userinfo,sizeof(userinfo_t));

    
}
